<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>.: BYKOM :: Web.Cliente :.</title>
<link href="../styles/login.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../js/browserdetect.js"></script>
<script language="javascript" src="../js/json.js"></script>
<?php include ("../config.php");?>
</head>
<body onLoad="mailSendStatus()">
<div id="loginPAGE" style="display:;">
  <div id="loginBOX" class="rounded shadow">
    <div id="logo_login_home"></div>
    <div id="imagen_login_home" class="email"></div>
    <div class="formContainer">
    <p></p>
      <div class="sendMailBGimage" align="left">
             <img src="../images/sendmailANIME.gif" border="0">
       </div>
    </div>
  </div>
  <div id="loginFOOTER"> <span class="textWelcome"> &copy; 2009 Bykom S.A.. Todos los Derechos Reservados.<br>
    <a href=#>Pol&iacute;tica de Privacidad</a> | <a href=#> Acceso Administrativo</a> </span>
    <table width="100%" align="center" cellspacing="5">
      <tr>
        <td>&nbsp;</td>
        <td width="24"><img src="../images/browser_chrome.png" title="Google Chrome"></td>
        <td width="24"><img src="../images/browser_firefox.png" width="24" height="26" title="Mozilla Firefox"></td>
        <td width="24"><img src="../images/browser_ie.png" title="Microsoft Internet Explorer 6.0 y superiores"></td>
        <td>&nbsp;</td>
      </tr>
    </table>
  </div>
</div>
</body>
</html>
<script type="text/javascript">
	var codeEmail = <?= $_REQUEST['codeEmail']; ?>;
	var timer = (new Date()).getTime() + (1000 * <?= SENDMAIL_TIMEOUT ?>);
	var reqHandlerEmail;
	function mailSendStatus(){
		var actualTime = (new Date()).getTime();		
		if (actualTime > timer){
			//se vencio el tiempo de espera para procesar el envio del mail
			location.href = '../welcome.php?error=' + 24;
			return;
		}	
		var addParams = "";
		addParams += "COMMAND=SENDMAILSTATUS";
		addParams += "&ID=" + codeEmail;
		if (msie) 
         	reqHandlerEmail = new ActiveXObject("Microsoft.XMLHTTP");
        else
        	reqHandlerEmail = new XMLHttpRequest();
        reqHandlerEmail.onreadystatechange = OnReadyStateSendStatus;    
        reqHandlerEmail.open("POST", "../querycontroller.php", true);
        reqHandlerEmail.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	    reqHandlerEmail.send(addParams);
	}
	
	function OnReadyStateSendStatus(){
		var ready = reqHandlerEmail.readyState;
		if (ready == 4) {
			if (reqHandlerEmail.responseText != 'undefined') {
				var sendStatus = reqHandlerEmail.responseText.parseJSON();
				if (parseInt(sendStatus[0])==1)
					location.href = '../welcome.php?error=14';
				else
					mailSendStatus();
			}
		}
	}

</script>